sched: clarify use cases of schedule_cpu_switch()
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 24 Nov 2015 13:49:09 +0000 (14:49 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 24 Nov 2015 13:49:09 +0000 (14:49 +0100)
commita8c6c623192e3610033e8c79533bd0995038c4dc
tree8b4c28495b4c4027bf8d20435524e087a611f14e
parentae2f41e3d7e7798537b7ea6dbb9a0c6aeb1179e3
sched: clarify use cases of schedule_cpu_switch()

schedule_cpu_switch() is meant to be only used for moving
pCPUs from a cpupool to no cpupool, and from there back
to a cpupool, *not* to move them directly from one cpupool
to another.

This is something inherent to the way the function is
implemented and called, but is not that clear, just by the
look of it.

Make it more evident by:
 - adding commentary and ASSERT()s;
 - update the cpupool per-CPU variable (mapping pCPUs to
   pools) directly in schedule_cpu_switch(), rather than
   in various places in cpupool.c.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Juergen Gross <jgross@suse.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/cpupool.c
xen/common/schedule.c